#include "IpcMqttCommon.h"

#define DEF_TAG "IpcMqttCom"

Com_s8 g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_INDEX_MAX][128];

StIpcMqttComCmdInfo g_IpcMqttProperty_CmdData[IPC_MQTT_PROPERTY_MAX] = {
    {IPC_MQTT_PROPERTY_POSTVERINFO, "PostVerInfo"},
    {IPC_MQTT_PROPERTY_DEVINFO, "DevInfo"},
    {IPC_MQTT_PROPERTY_NETINFO, "NetInfo"},
    {IPC_MQTT_PROPERTY_DEVTIME, "DevTime"},
    {IPC_MQTT_PROPERTY_VIDEOENCODE, "VideoEncode"},
    {IPC_MQTT_PROPERTY_ISPPARAM, "IspParam"},
    {IPC_MQTT_PROPERTY_RECORDCHN, "RecordChn"},
    {IPC_MQTT_PROPERTY_OSDMODE, "OSDMode"},
    {IPC_MQTT_PROPERTY_CUSTOMOSD, "CustomOSD"},
    {IPC_MQTT_PROPERTY_GB28181PARAM, "GB28181Param"},
    {IPC_MQTT_PROPERTY_CRUISEDATA, "CruiseData"},
    {IPC_MQTT_PROPERTY_POSTTFINFO, "PostTFInfo"},
    {IPC_MQTT_PROPERTY_TIMINGSNAPSHOT, "TimingSnapshot"},
};

StIpcMqttComCmdInfo g_IpcMqttService_CmdData[IPC_MQTT_SERVICE_MAX] = {
    {IPC_MQTT_SERVICE_PTZCTRL, "PtzCtrl"},
    {IPC_MQTT_SERVICE_PTZPRESET, "PtzPreset"},
    {IPC_MQTT_SERVICE_PTZCRUISE, "PtzCruise"},
    {IPC_MQTT_SERVICE_3DPOS, "3DPos"},
    {IPC_MQTT_SERVICE_MANUALSNAPSHOT, "ManualSnapshot"},
    {IPC_MQTT_SERVICE_REBOOT, "Reboot"},
    {IPC_MQTT_SERVICE_MEDIALIVE, "MediaLive"},
    {IPC_MQTT_SERVICE_TFUSE, "TFUse"},
    {IPC_MQTT_SERVICE_OTA, "OTA"},
};

StIpcMqttComCmdInfo g_IpcMqttEvent_CmdData[IPC_MQTT_SERVICE_MAX] = {
    {IPC_MQTT_EVENT_PRESETRESULT, "PresetResult"},
    {IPC_MQTT_EVENT_CRUISERESULT, "CruiseResult"},
    {IPC_MQTT_EVENT_PICRESULT, "PicResult"},
    {IPC_MQTT_EVENT_TFSTATUSRESULT, "TFStatusResult"},
    {IPC_MQTT_EVENT_OTARESULT, "OtaResult"},
};

Com_ps8 Ext_Get_g_IpcMqttTopic_Info(Com_u32 index)
{
    return g_IpcMqttTopic_Info[index];
}

pStIpcMqttComCmdInfo Ext_Get_g_IpcMqttProperty_CmdData(void)
{
    return g_IpcMqttProperty_CmdData;
}

pStIpcMqttComCmdInfo Ext_Get_g_IpcMqttService_CmdData(void)
{
    return g_IpcMqttService_CmdData;
}

pStIpcMqttComCmdInfo Ext_Get_g_IpcMqttEvent_CmdData(void)
{
    return g_IpcMqttEvent_CmdData;
}

void Ext_IpcMqttCom_TopicInit(void)
{
    memset(&g_IpcMqttTopic_Info, 0, sizeof(g_IpcMqttTopic_Info));

    sprintf(g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_PROPERTY_POST], "/zkkc/a123/property/post");
    sprintf(g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_PROPERTY_GET], "/zkkc/a123/property/get");
    sprintf(g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_SERVICE_POST], "/zkkc/a123/service/post");
    sprintf(g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_SERVICE_GET], "/zkkc/a123/service/get");
    sprintf(g_IpcMqttTopic_Info[IPC_MQTT_COM_TOPIC_EVENT_POST], "/zkkc/a123/event/post");
}